<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');


	/**
		* 图片所属，返回图片的路径
	*/
	
	if ( ! function_exists('imgurl'))
	{
		function imgurl($probelong=1)
		{	
			if($probelong==1)
			return '/user';
			else
			return '/shop';
		}
	
	
	}

	// ------------------------------------------------------------------------
	/**
		* 返回图片字符串中的第一张图片的图片名称
	*/

	if( ! function_exists('getfirstp'))	
	{
		function getfirstp($pic)
		{
			$arrurl =  preg_split("/@/",$pic);
			return $arrurl[0];
		}
	}




	// ------------------------------------------------------------------------
	/**
		* 将图片字符串变成数组
	*/
	if(!  function_exists('getarrp'))
	{
		function getarrp($pic)
		{
			$arrurl =  preg_split("/@/",$pic);
			return $arrurl;
		}
	}
	

	// ------------------------------------------------------------------------
	/**
		* 返回缩略图名称
	*/

	if(!  function_exists('dst_img'))
	{
	   function dst_img($srcimg)
	   {
		   $type =		substr(strrchr($srcimg,"."),1);
		   $full_length = strlen($srcimg);
		   $type_length = strlen($type);
		   $name_length = $full_length-$type_length;
		   $name         = substr($srcimg,0,$name_length-1);
		   $dstimg =  $name."_icon.".$type;
		   return $dstimg;
	   }
   }







